import instance from "../utils/request";

//存放用户有关方法

//登入数据
export function login(obj) {
  return instance({
    method: "post",
    url: "/admin/admin/login",
    data: obj,
  });
}

//获取管理员数据列表
export function getmanagerdata() {
  return instance({
    url: "/admin/admin/list",
    method: "get",
  });
}

//删除管理员
export function delmanager(item) {
  return instance({
    url: "/admin/admin/delete",
    method: "post",
    data: item,
  });
}

//添加管理员
export function addmanager(obj) {
  return instance({
    url: "/admin/admin/add",
    method: "post",
    data: obj,
  });
}

//修改管理员信息
export function updatemanager(obj) {
  return instance({
    url: "/admin/admin/update",
    method: "post",
    data: obj,
  });
}

//获取管理员信息
export function getemanager(item) {
  return instance({
    url: `/admin/admin/detail/?adminname=${{ item }}`,
    method: "get",
  });
}

//获取用户列表
export function getusersdata() {
  return instance({
    url: "/admin/user/list",
    method: "get",
  });
}

//用户总数量
export function getusersnum() {
  return instance({
    url: "/admin/statistic/user",
    method: "get",
  });
}
